/*    */ package com.wzh.action.front.book;
/*    */ 
/*    */ import com.opensymphony.xwork2.ActionContext;
/*    */ import com.wzh.action.front.CommonAction;
/*    */ import com.wzh.bean.book.BookInfo;
/*    */ import com.wzh.constant.CommonConstant;
/*    */ import com.wzh.service.bookinfo.BookInfoService;
/*    */ import com.wzh.utils.WebTool;
/*    */ import javax.annotation.Resource;
/*    */ import org.apache.struts2.ServletActionContext;
/*    */ import org.springframework.stereotype.Controller;
/*    */ 
/*    */ @Controller
/*    */ public class BookAction extends CommonAction
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/*    */ 
/*    */   @Resource
/*    */   private BookInfoService bookService;
/*    */   private Integer bookid;
/*    */ 
/*    */   public Integer getBookid()
/*    */   {
/* 27 */     return this.bookid;
/*    */   }
/*    */ 
/*    */   public void setBookid(Integer bookid) {
/* 31 */     this.bookid = bookid;
/*    */   }
/*    */ 
/*    */   public String getBookById() {
/* 35 */     BookInfo bookInfo = (BookInfo)this.bookService.find(this.bookid);
/*    */ 
/* 37 */     bookInfo.setHit(Integer.valueOf(bookInfo.getHit().intValue() + 1));
/* 38 */     this.bookService.update(bookInfo);
/*    */ 
/* 40 */     this.bookService.setInfo(bookInfo, true, true);
/*    */ 
/* 43 */     String booktxturl = CommonConstant.TXTPATH + "/" + this.bookid + "/" + bookInfo.getTitle() + ".zip";
/* 44 */     ActionContext.getContext().put("booktxturl", booktxturl);
/* 45 */     ActionContext.getContext().put("bookInfo", bookInfo);
try {
    ActionContext.getContext().put("_title", new String(bookInfo.getTitle().getBytes("UTF-8")));
}catch (Exception e){
    e.printStackTrace();
}
/*    */ 
/* 47 */     if (WebTool.isMHost(ServletActionContext.getRequest()))
/*    */     {
/* 49 */       this.template += "/mobile";
/*    */     }
/* 51 */     return "book";
/*    */   }
/*    */ }

/* Location:           C:\work\apache-tomcat-7.0.55\webapps\ROOT\WEB-INF\classes\
 * Qualified Name:     com.wzh.action.front.book.BookAction
 * JD-Core Version:    0.6.1
 */